package study;

public class BetterProgrammerTask {

    public static void main(String[] args) {

        int[] tmp = new int[]{-2, 3, 0, 4, 2};


        getClosestToZero(tmp);


    }

    public static int getClosestToZero(int[] a) {

        int[] help = new int[a.length];
        int min = 0;

        for (int i = 0; i < a.length; i++) {



            help[i]=Math.abs(0 - Math.abs(a[i]));


            System.out.println(Math.abs(0 - Math.abs(a[i])));
        }

        return 1;

        /*
         Please implement this method to
         return the number in the array that is closest to zero.
         If there are two equally close to zero elements like 2 and -2
         - consider the positive element to be "closer" to zero.
        */
    }
}



